package ${packageName};

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
* ${tableComment} 转换器
* @author lmabbe
*/
@Mapper(componentModel = "spring")
public interface ${tableName}Converter {

    /**
    * dto转实体
    *
    * @param to
    * @return
    */
    ${tableName} dto2Entity(${tableName}DTO to);

    /**
    * dto转实体
    *
    * @param to
    * @return
    */
    @Mapping(target = "${pkField}", source = "${pkField}")
    ${tableName} dto2Entity(${tableName}DTO to, Long ${pkField});

    /**
    * 数据列表转Vo列表
    *
    * @param list
    * @return
    */
    List<${tableName}VO> list2Vos(List<${tableName}> list);

    /**
    * 实体转VO
    *
    * @param entity
    * @return
    */
    ${tableName}VO entity2Vo(${tableName} entity);
}